package com.xm.service.impl;

import com.github.pagehelper.PageHelper;
import com.xm.mapper.PsychologyMapper;
import com.xm.pojo.Psychology;
import com.xm.pojo.search.PsySearch;
import com.xm.pojo.vo.ConKnowPVo;
import com.xm.service.PsychologyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PsychologyServiceImpl implements PsychologyService {

    @Resource
    private PsychologyMapper psychologyMapper;

    @Override
    public List<Psychology> queryPsyAllService(PsySearch psySearch) throws Exception {
        PageHelper.startPage(psySearch.getCurrentPage(),psySearch.getPageSize());
        List<Psychology> psychologies = psychologyMapper.queryPsyAllMapper(psySearch);
        return psychologies;
    }

    @Override
    public List<ConKnowPVo> queryConKnowService() throws Exception {
        return this.psychologyMapper.queryConKnowMapper();
    }

    @Override
    public int addPsyDataService() throws Exception {
        return this.addPsyDataService();
    }

    @Override
    public int updatePsyDataService() throws Exception {
        return this.updatePsyDataService();
    }
}
